package cn.techcave.demo.jpa3.web

import cn.techcave.demo.jpa3.service.RecordService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RestController

@RestController
class RecordController {

    @Autowired
    lateinit var recordSvc:RecordService

    @GetMapping("findAll")
    fun findAll() = recordSvc.findAll()

    @GetMapping("findByName")
    fun findByName(name:String) = recordSvc.filterByName(name)

    @GetMapping("findByNames")
    fun findByNames(n1:String, n2:String) = recordSvc.filterByNames(n1, n2)
}